package baseTest;

import java.math.BigInteger;
import java.util.Scanner;

public class BigIntegerTest {
    public static void main(String[] args) {
         Scanner scanner = new Scanner(System.in);

         int n =scanner.nextInt();

         BigInteger bigInteger = new BigInteger("0");

        for (int i = 1; i <=n; i++) {

         BigInteger b1 = new BigInteger("1");

            for (int j = i; j >=1 ; j--) {
                BigInteger b2 = new BigInteger(String.valueOf(j));
                b1 = b1.multiply(b2);
            }
            bigInteger = bigInteger.add(b1);
        }
        System.out.println(bigInteger);
    }
}
